package com.zcup.designer.construct.composite;

public class Leaf extends Component{
    public Leaf(String id) {
        super(id);
    }

    @Override
    void add(Component component) {
        throw new RuntimeException("error, can not add");
    }

    @Override
    void remove(Component component) {
        throw new RuntimeException("error, nothing can be remove");
    }

    @Override
    void display(int depth) {
        System.out.println(getLine(depth) + getId());
    }
}
